package com.chen.Main;

import com.chen.pojo.Hello;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MainHello2 {
    public static void main(String[] args) {
       ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        Hello hello2 = (Hello) context.getBean("hello2");
        hello2.setMessage("加油");
        hello2.getMessage();
        System.out.println("=======");
        Hello hello21 = (Hello) context.getBean("hello2");
        hello21.getMessage();

    }
}
